/*
 * Created by Christopher King
 * Copyright (C) 2007 Christopher King, All Rights Reserved.
 */

package us.cirion.adventure.ui.mobile;

/**
 * CardinalLayout describes the position and identity of a cardinal direction
 * indicator. A Cardinal is one of the four compass points - North, South, East,
 * West - and each CardinalLayout describes where one of those compass points
 * should be drawn on the screen.
 * 
 * @author Chris
 */
class CardinalLayout
{

	private int x;
	private int y;
	private int cardinal;

	/**
	 * Constructs a new cardinal layout.
	 * 
	 * @param cardinal One of Direction.UP, Direction.DOWN, Direction.LEFT, or
	 *            Direction.RIGHT.
	 * @param x The horizontal position of the cardinal's center.
	 * @param y The vertical position of the cardinal's center.
	 */
	public CardinalLayout(int cardinal, int x, int y)
	{
		this.x = x;
		this.y = y;
		this.cardinal = cardinal;
	}

	/**
	 * Retrieves the horizontal position of the cardinal's center.
	 * 
	 * @return The horizontal position of the cardinal's center.
	 */
	public int getX()
	{
		return x;
	}

	/**
	 * Retrieves the vertical position of the cardinal's center.
	 * 
	 * @return The vertical position of the cardinal's center.
	 */
	public int getY()
	{
		return y;
	}

	/**
	 * Indicates to which direction this cardinal layout corresponds.
	 * 
	 * @return One of Direction.UP, Direction.DOWN, Direction.LEFT, or
	 *         Direction.RIGHT.
	 */
	public int getCardinal()
	{
		return cardinal;
	}
}
